Template-based image recognition and extraction

ABSTRACT

Position, size and attribute regarding one or a plurality of areas in an image are held as template information. Block areas such as text areas and figure areas are extracted from a document image that has entered from a scanner and an attribute is added to each block area. A block area that at least partially overlaps an area indicated by the template information and whose attribute agrees with the attribute included in the template information is acquired as extracted information from the block areas that have been extracted. This makes it possible to reliably extract a desired area from an entered document image while employing a template.

BACKGROUND OF THE INVENTION

This invention is applicable to electronic equipment such as an OCR(optical character reader), copier, facsimile machine or processor forimplementing an electronic database and, more particularly, relates toan image processing apparatus and method for extracting a specificdesired area from a document image.

Two methods of extracting a desired area from a document are available.The first method is such that whenever the operator wishes to extract adesired area, the operator designates this area in an input image eachtime. This method involves reading the document image using a scanner,displaying the scanned image on a display monitor and having theoperator designate the desired area using a mouse or the like.

The second method involves creating a template for which size andposition information representing rectanglar areas has been decided inadvance, applying the rectangular areas decided by the template directlyto an input image and then extracting these areas from the input image.In this case rectangular areas whose positions and sizes have beendecided by the template are extracted from a scanned document image andthe operator need no longer perform the laborious task of specifyingextraction areas one after another.

The first method is disadvantageous in that the operator must specifythe desired area each time. This method, therefore, is not suited to theprocessing of a large number of documents. The second method using thetemplate is disadvantages in that if there is a disparity in position orsize between an area to be extracted from the input image and therectangular area decided by the template, the area to be extracted maybe omitted in the extraction process.

SUMMARY OF THE INVENTION

The present invention has been devised in view of the foregoing problemsand its object is to provide an image processing apparatus and methodwhereby it is possible to extract a desired area from a document imagein reliable fashion.

Another object of the present invention is to make possible the rapidand reliable extraction of a desired area from a large quantity ofdocument images.

A further object of the present invention is to provide an imageprocessing apparatus and method whereby it is possible to reliablyextract a desired area from an entered document image while employing atemplate.

An image processing apparatus according to one mode of the presentinvention for attaining the foregoing objects comprises: holding meansfor holding position, size and attribute as template information inregard to one or a plurality of areas in an image; image input means forinputting a document image; first extraction means for extracting blockareas from the document image input by the image input means andevaluating attributes of the extracted block areas; and secondextraction means for extracting, from block areas that have beenextracted by the first extraction means, a block area that at leastpartially overlaps an area indicated by the template information andwhose attribute agrees with the attribute included in the templateinformation.

An image processing method according to another mode of the presentinvention for attaining the foregoing objects comprises: a holding stepof holding position, size and attribute as template information inregard to one or a plurality of areas in an image; an image input stepof inputting a document image; a first extraction step of extractingblock areas from the document image input at the image input step andevaluating attribute of the extracted block areas; and a secondextraction step of extracting, from block areas that have been extractedat said first extraction step, a block area that at least partiallyoverlaps an area indicated by the template information and whoseattribute agrees with the attribute included in the templateinformation.

Other features and advantages of the present invention will be apparentfrom the following description taken in conjunction with theaccompanying drawings, in which like reference characters designate thesame or similar parts throughout the figures thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate embodiments of the invention and,together with the description, serve to explain the principles of theinvention.

FIG. 1 is a block diagram illustrating the construction of an imageprocessing apparatus according to a first embodiment of the presentinvention;

FIG. 2 is a flowchart for describing the procedure of template saveprocessing according to the first embodiment;

FIG. 3 is a flowchart for describing the procedure of area extractionprocessing according to the first embodiment;

FIG. 4 is a diagram showing an example of a document (document A) readin for the purpose of generating template data;

FIG. 5 is a diagram showing an example of the display of a screen forsetting areas in template save processing according to the firstembodiment;

FIGS. 6A, 6B are diagrams useful in describing the data structure oftemplate data generated by designation of areas and setting ofattributes;

FIG. 7 is a diagram for describing the registered state of templatedata;

FIG. 8 is a diagram illustrating the manner in which a “Document ATemplate” is registered in the template data;

FIG. 9 is a diagram showing a document B, which is an example of adocument to be processed;

FIG. 10 is a diagram showing an example of results obtained by executingarea partitioning processing in regard to the document B of FIG. 9;

FIG. 11 is a diagram useful in describing the manner in which a templateand the blocks of a document are compared;

FIG. 12 is a flowchart illustrating the procedure of template saveprocessing according to a second embodiment of the present invention;

FIG. 13 is a diagram showing an example of results of area partitioningprocessing in this case;

FIG. 14 is a flowchart illustrating the procedure of template saveprocessing according to a third embodiment of the present invention;

FIG. 15 is a diagram showing a state in which a block 3 and a block 5have been selected in template save processing according to the thirdembodiment;

FIG. 16 is a diagram showing the data structure of the document Atemplate in the third embodiment;

FIG. 17 is a diagram useful in describing results of comparing blocks ina case where a desired area is extracted from the document B using thedocument A template of FIG. 16;

FIG. 18 is a flowchart illustrating the procedure of template saveprocessing according to a fourth embodiment of the present invention;and

FIG. 19 is a flowchart for describing the procedure of area extractionprocessing according to a fifth embodiment of the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Preferred embodiments of the present invention will now be described indetail in accordance with the accompanying drawings.

[First Embodiment]

FIG. 1 is a block diagram illustrating the construction of an imageprocessing apparatus according to a first embodiment of the presentinvention. The apparatus includes a scanner 101 for irradiating adocument having an image, reading the reflected light and converting thereflected light to an electric signal; a scanner interface 102 forconverting the electric signal obtained by the scanner 101 to a binarydigital signal and sending this signal to other components; a pointingdevice 103 (since a mouse is used in this embodiment, the device will bereferred to as a mouse below) for entering desired coordinates on thewindow of a display; an interface circuit 104 for receiving a signalfrom the mouse 103 and transmitting the signal to other components; aCPU 105 for executing overall control of the apparatus and processingsuch as area partitioning; a ROM 106 storing programs, which areexecuted by the CPU 105, for various control operations and for variousprocessing, as well as font data; a RAM 107 used as a working area forexpanding a document image and for area partitioning processing; adisplay 108 for displaying input images and the like, wherein an imagedisplayed is stored in a VRAM area created by a prescribed address areain the RAM 107; an external storage device 110 such as a hard disk inwhich data and the like is stored; and an interface 111 for the externalstorage device 110. These components are interconnected by a bus 112.

The flow of processing according to the first embodiment will now bedescribed in accordance with the flowcharts of FIGS. 2 and 3. FIG. 2 isa flowchart useful in describing the procedure of processing for savinga template according to the first embodiment, and FIG. 3 is a flowchartuseful in describing the procedure of processing for extracting an areaaccording to the first embodiment.

Processing for saving a template used in area extraction will bedescribed first with reference to FIG. 2. A document A of the kind shownin FIG. 4 having a format desired to be saved is read and converted tobinary image data by a scanner 101 at step S201. Next, at step S201,small areas (referred to simply as “areas” or “blocks” below) havingattributes such as “text”, “table” and “figure” are set on the inputimage obtained.

According to this embodiment, the document A of FIG. 4 is read by thescanner and the read image is displayed on the display 108. FIG. 5 is adiagram showing the display of a screen for setting areas in templatesave processing according to the first embodiment. An attribute menu 51is displayed together with the image of document A on the display 108.The operator uses the mouse 103 to select a desired attribute from theattribute menu 51 and to designate frames indicative of rectangularareas. By thus causing the frames of selected attributes to be displayedat desired positions, attributes are set in regard to each rectangulararea. When a desired attribute is selected from the attribute menu 51,the color of the border of the rectangular frame displayed by operatingthe mouse 103 is set to a color that is associated with the selectedattribute. In FIG. 5, the border color of a rectangular frame 501 isblack, which indicates that the attribute of this area is “text”. Theborder color of a rectangular frame 502 is red, which indicates that theattribute of this area is “table”. The border color of a rectangularframe 504 is yellow, which indicates that the attribute of this area is“figure”.

FIGS. 6A, 6B are diagrams useful in describing the data structure oftemplate data generated by designation of areas and setting ofattributes. Area data is stored on an area-by-area (block-by-block)basis in the manner shown in FIG. 6A. The area data is obtained byregistering starting-point coordinates X, Y, width and height of thearea (namely position information indicative of the rectangular framedisplayed by operating the mouse), and includes an “attribute” field inwhich an identification number corresponding to the attribute set forthe above-mentioned rectangular frame is set. Each attribute and itsidentification number are as shown in FIG. 6B. It should be noted thatthe X, Y coordinates of the starting point represent the upper leftcorner of the particular area.

Next, at step S203, the assemblage of area data of each of the blocksset in the manner described above is registered and saved as a template.For example, FIG. 7 shows an example in which a template is registeredanew under the title “Document A Template” as the fourth of a group ofalready existing templates.

FIG. 8 is a diagram illustrating the manner in which a “Document ATemplate” is registered in the template data. Since the areas indicatedby the rectangular frames 501-505 have been set on the image of documentA in the manner shown in FIG. 5, five blocks are registered in thedocument A template. Which rectangular frame corresponds to which blockof the blocks 1-5 may be decided, by way of example, in accordance withthe order in which the rectangular frames were designated at step S202.

Processing for extracting desired areas from a newly read image using atemplate registered in the manner described above will now be explainedwith reference to the flowchart of FIG. 3.

First, a template necessary to extract desired areas is selected at stepS301. In this embodiment, the template names of templates registered asshown in FIG. 7 are displayed on the display 108 and the operator isallowed to select the desired template using the mouse 103. Next, atstep S302, a document to undergo processing is read by the scanner 101and converted to binary image data in order that the area partitioningprocessing, described later, may be executed. This example will bedescribed on the assumption that the document A template set at shown inFIG. 5 has been selected and that a document B, shown in FIG. 9, hasbeen read in as the document to be processed.

This is followed by step S303, at which the input image obtained issubjected to area partitioning processing known to those skilled in theart, blocks are extracted and the attribute of each block is evaluated.FIG. 10 is a diagram showing an example of results obtained by executingarea partitioning processing in regard to the document B. Each block ofthe blocks A-E is stored as extracted area information, with the datastructure of the stored blocks being the same as that of the areainformation shown in FIGS. 6A, 6B. In other words, informationrepresenting the position, size and attribute of each extracted block isstored.

Next, at step S304, area data of blocks that have been extracted fromdocument B are compared with the area data of blocks that have beensaved in a selected template (the document A template). This is followedat step S305 by the extraction of a block whose area at least partiallyoverlaps the area of a block in the template and has the same attributeas that of the area it overlaps. If such a block is extracted at stepS305, then this block is deemed to be a block identical with the desiredblock and the image contained in the area of this block is output atstep S306.

FIG. 11 is a diagram useful in describing the manner in which a templateand the blocks of a document are compared. Blocks that have beenrecorded as the document A template are indicated by dashed lines inFIG. 11, and blocks that have been extracted from the image of documentB are indicated by broken lines. Though blocks A and B that have beenextracted from document B are somewhat displaced from the blockpositions of the document A template, the blocks A and B have portionsthat overlap the block positions of the template. The attribute of bothof these areas is “text”. Blocks A and B, therefore, are extracted atstep S305. The end result is that the area data of all blocks A-E ofdocument B obtained in FIG. 10 is output.

Thus, in accordance with the first embodiment, as described above, evenif the position and size of an area set in a template differ slightlyfrom the position and size of an area to be extracted from a documentimage that has actually been read, a desired area can be extracted fromthe document image reliably.

At step S305 described above, a block extracted at least partiallyoverlaps an area set in the template and has the same attribute as thatof this area. However, whether or not a block is to be extracted may bedecided upon taking into account the degree of overlap between the twoblocks. For example, it may be so arranged that a block to be selectedmust overlap a block in the template by 70% or more and must have thesame attribute. Furthermore, an arrangement may be adopted in which thisratio can be set for each block of the template.

[Second Embodiment]

According to the first embodiment described above, the setting of areassaved in a template is performed manually using the mouse 103. However,area setting processing for saving a template can be automated usingarea partitioning processing of the kind executed at step S303.

The flow of such processing will be described in accordance with theflowchart of FIG. 12. FIG. 12 is a flowchart illustrating the procedureof template save processing according to the second embodiment of thepresent invention.

The document A (see FIG. 4) having the format desired to be saved isread in and converted to binary image data, which is for areapartitioning processing described below, by the scanner at step S1201.The input image obtained is then subjected to area partitioningprocessing at step S1202 to extract various areas (blocks) such as atext area, figure area, table area and title area. It should be notedthat the area partitioning processing used at step S1202 may employ atechnique will known to those skilled in the art. The result of thisarea partitioning processing is shown in FIG. 13. Each block is thusextracted and identification numbers corresponding to the variousattributes as well as the position information are obtained as areapartitioning data on a per-block basis. The structure of the area dataregarding this document in this case can be assumed to be the same asthat shown in FIG. 6. The area data of each of the extracted blocks isthen registered and saved as the “Document A Template” in the mannerillustrated in FIG. 8.

It should be noted that the processing for extracting areas from theimage of an input document using the template registered as set forthabove is as described earlier in conjunction with the flowchart of FIG.3.

Thus, in accordance with the arrangement described above, a document toserve as a template need only be read by the scanner 101 to generate thetemplate automatically. This enhances operability.

[Third Embodiment]

In the second embodiment, all areas extracted by area partitioningprocessing in template save processing are saved as a template. However,it can be so arranged that only a desired area among the extracted areasis selected and saved as a template. In the third embodiment, specificblocks among blocks extracted in area partitioning processing aredesignated by the mouse 3 and only the area partitioning data of theseblocks are saved as a template.

FIG. 14 is a flowchart illustrating the procedure of processing forsaving a template according to the third embodiment. The flow ofprocessing of the third embodiment will now be described in accordancewith the flowchart of FIG. 14.

The document A (see FIG. 4) having the format desired to be saved isread in and converted to binary image data by the scanner 101 at stepS1401. The input image obtained is then subjected to area partitioningprocessing at step S1402 to extract various areas (blocks) such as atext area, figure area, table area and title area. The result of thisextraction is as described above in connection with the secondembodiment (FIG. 13). By way of example, area partitioning processingindicated at step S303 in FIG. 3 can be used as the area partitioningprocessing at step S1402.

This is followed by step S1403, at which specific blocks are selectedfrom the extracted blocks using the mouse 103. FIG. 15 is a diagramshowing a state in which a block 3 and a block 5 have been selected. Inthe case of the example shown in FIG. 15, the selected blocks areindicated by hatching so as to be distinguished from other blocks.

Next, at step S1404, only the area partitioning data (attributes andposition information, etc.) of the blocks selected at step S1403 issaved as a template. In this example, only the area partitioning data ofblocks 3 and 5 is saved as the document A template in the manner shownin FIG. 16.

A case where document B shown in FIG. 9 is processed using the documentA template saved in the manner explained above will now be described.FIG. 17 is a diagram useful in describing results of comparing thetemplate and each block of a document in a case where desired areas areextracted from the document B using the template composed solely of theblocks selected in FIG. 15. If the area extraction processing of FIG. 3is executed in the case of this example, only the area partitioning dataof blocks C and E is output. The blocks C and E among the blocks(indicated by the broken lines) of document B are judged to be areasthat at least partially overlap the blocks (indicated by the dashedlines) recorded in the template and that have the same attributes asthose of the template blocks.

Thus, in accordance with the third embodiment, as described above,desired areas can be selected from automatically extracted area data andthe selected areas can be saved as a template.

[Fourth Embodiment]

In the third embodiment, areas to be saved as a template are designatedby the operator. However, it goes without saying that areas that are notto be saved as a template may be designated by the operator. In thefourth embodiment, a desired area among blocks that have been extractedby area partitioning processing is designated by a mouse or the like andarea data of blocks other than the designated block are saved as atemplate.

FIG. 18 is a flowchart for describing the procedure of processing forsaving a template according to the fourth embodiment. The document A(see FIG. 4) having the format desired to be saved is read in andconverted to binary image data by the scanner 101 at step S1801. Theinput image obtained is then subjected to area partitioning processingat step S1802 to extract various areas (blocks) such as a text area,figure area, table area and title area. This extraction operationprovides results already described above in connection with the secondembodiment (FIG. 13).

Next, at step S1803, desired blocks are selected from among theextracted blocks by using the mouse 103. For example, in FIG. 15described above, blocks 3 and 5 are illustrated as being in the selectedstate. As shown in FIG. 15, the selected blocks are indicated byhatching so as to be distinguished from other blocks. Whereas theseselected blocks were registered as a template in the third embodiment,the area data of these selected blocks is deleted in accordance with thefourth embodiment. Though the interior of a rectangular area of aselected and deleted block is hatched in the description given above,the method of representing a selected area is not limited to thisexpedient. For example, an arrangement may be adopted in which the frameborder indicating the rectangle of the block is erased along with thedeletion of the area data.

Next, at step S1804, only the area partitioning data (attributes andposition information, etc.) of the blocks selected at step S1803 issaved as a template. In this example, only the area partitioning data ofblocks 1, 2 and 4 is saved as the document A template as the result ofthe selections shown in FIG. 15.

The extraction of areas from an input document image using a templatethus obtained is as already described above with reference to theflowchart of FIG. 3 in the first embodiment.

[Fifth Embodiment]

In each of the foregoing embodiments, documents to be processed areplaced in the scanner 101 and read in one by one. However, automaticextraction by template in a case where a large number of documents havebeen entered by the scanner 101 using an ADF (Automatic Document Feeder)also is possible. FIG. 19 is a flowchart for describing the procedure ofarea extraction processing according to a fifth embodiment of thepresent invention. The flow of processing will now be described inaccordance with the flowchart of FIG. 19. It should be noted that theprocessing of steps S1901, S1903-S1907 is the same as that of stepsS301-S306 in the first embodiment.

The method of template registration may employ the technique of any ofthe first through fourth embodiments described above.

A desired template to be used to extract desired areas is selected atstep S1901. Next, it is determined at step S1902 whether there is adocument to be input, i.e., whether there is a document in the ADF. Ifthe decision rendered is “YES”, control proceeds to step S1903, wherethe document is read by the scanner and converted to binary image databy the scanner 101. If the decision at step S1902 is “NO”, however, thenthis processing is terminated.

Next, the input image obtained is subjected to area partitioningprocessing at step S1904 to extract blocks. For example, if document Bshown in FIG. 9 was read in at step S1903, then results of the kindshown in FIG. 10 are obtained by the area partitioning processingexecuted at step S1904.

Next, at step S1905, area data of a blocks that have been extracted bythe area partitioning processing of step S1904 are compared with areadata of blocks that have been saved in the template elected at stepSl901. This is followed by step S1906, namely by the extraction of ablock whose area at least partially overlaps the area of a block in thetemplate and has the same attribute as that of the area it overlaps.Here the extracted block is construed to be a block identical with thedesired block defined in the template and the area partitioning data ofthis block is output (step S1907).

For example, if the document A template obtained based upon document Ashown in FIG. 5 is selected and the document B shown in FIG. 9 is readin by the scanner 101 and processed, then areas overlap as shown in FIG.11. (Blocks that have been recorded as the document A template areindicated by dashed lines, and blocks that have been extracted from theimage of document B are indicated by broken lines.) Since the attributesof the blocks whose areas overlap each other are the same (see FIGS. 5and 10), the data of the areas of all blocks in the document B obtainedin FIG. 10 is output. Control then returns to step S1902 and processingcontinues.

Thus, in accordance with each of the embodiments as described above, thefollowing advantages are obtained when desired areas are extracted froma document image by a template: (1) Operator intervention is reduced;(2) the accuracy of desired area extraction is improved; (3) largequantities of documents can be processed automatically; (4) operabilityis enhanced; and (5) overall processing time is shortened.

Though the block areas are set as rectangular areas in each of theforegoing embodiments, the areas may have any shape, such as circular orelliptical, as long as they are closed areas.

The present invention can be applied to a system constituted by aplurality of devices (e.g., a host computer, interface, reader, printer,etc.) or to an apparatus comprising a single device (e.g., a copier orfacsimile machine, etc.).

Furthermore, it goes without saying that the invention is applicablealso to a case where the object of the invention is attained bysupplying a storage medium storing the program codes of the software forperforming the functions of the foregoing embodiments to a system or anapparatus, reading the program codes with a computer (e.g., a CPU orMPU) of the system or apparatus from the storage medium, and thenexecuting the program codes.

In this case, the program codes read from the storage medium implementthe novel functions of the invention, and the storage medium storing theprogram codes constitutes the invention.

Further, the storage medium, such as a floppy disk, hard disk, opticaldisk, magneto-optical disk, CD-ROM, CD-R, magnetic tape, non-volatiletype memory card or ROM can be used to provide the program codes.

Furthermore, besides the case where the aforesaid functions according tothe embodiments are implemented by executing the program codes read by acomputer, it goes without saying that the present invention covers acase where an operating system or the like running on the computerperforms a part of or the entire process in accordance with thedesignation of program codes and implements the functions according tothe embodiments.

It goes without saying that the present invention further covers a casewhere, after the program codes read from the storage medium are writtenin a function extension board inserted into the computer or in a memoryprovided in a function extension unit connected to the computer, a CPUor the like contained in the function extension board or functionextension unit performs a part of or the entire process in accordancewith the designation of program codes and implements the function of theabove embodiment.

Thus, in accordance with the present invention as described above, it ispossible to reliably extract desired areas from an entered documentimage while employing a template.

As many apparently widely different embodiments of the present inventioncan be made without departing from the spirit and scope thereof, it isto be understood that the invention is not limited to the specificembodiments thereof except as defined in the appended claims.

What is claimed is:
 1. An image processing apparatus comprising: holdingmeans for holding template information including position, size andattribute in regard to one or a plurality of areas in a template; imageinput means for inputting a document image; partition means forpartitioning the input document image into block areas and evaluatingattributes of the partitioned block areas; and extraction means forextracting, from the partitioned block areas, a block area that at leastpartially overlaps an area indicated by the position and size includedin the template information and whose attribute agrees with theattribute of the overlapped area included in the template information.2. The apparatus according to claim 1, wherein said holding means holdsa plurality of template information of a plurality of templates; saidapparatus further comprising selecting means for selecting desiredtemplate information from the plurality of template information of theplurality of templates held by said holding means; wherein saidextraction means extracts, from the partitioned block areas, a blockarea that at least partially overlaps an area indicated by the positionand size included in the selected template information and whoseattribute agrees with the attributes of the overlapped area included inthe selected template information.
 3. The apparatus according to claim1, wherein said holding means includes: setting means for setting areaand attributes of the areas with respect to the template; andregistration means for registering, as template information, position,size and attribute of each area set by said setting means.
 4. Theapparatus according to claim 3, wherein said setting means includes:display means for displaying the template; and designation means forallowing a user to designate a desired area and attribute on thetemplate displayed by said display means, and wherein said registrationmeans registers, as template information, position and size of the areadesignated attribute.
 5. The apparatus according to claim 3, whereinsaid setting means sets an area and attribute, which are to serve astemplate information, by extracting a block area and its attributes fromthe template.
 6. The apparatus according to claim 1, wherein saidholding means includes: area acquisition means for acquiring a pluralityof areas and attribute of each area from the template; area selectionmeans for selecting a desired area from the plurality of areas acquiredby said area acquisition means; and registration means for registering,as template information, the selected area and its attribute selected bysaid area selection means.
 7. The apparatus according to claim 1,wherein said holding means includes: area acquisition means foracquiring a plurality of areas and attribute of each area from thetemplate; area selection means for selecting a desired area from theplurality of areas acquired by said area acquisition means; andregistration means for registration, as template information, the area,as well as its attribute, that has not been selected by said areaselection means.
 8. The apparatus according to claim 1, wherein saidextraction means extracts, from the partitioned block areas, a blockarea that overlaps, in excess of a predetermined ratio, an areaindicated by the position and size included in the template informationand whose attribute agrees with the attribute of the overlapped areaincluded in the template information.
 9. An image processing methodcomprising: a holding step of holding template information includingposition, size and attribute in regard to one or a plurality of areas ina template; an image input step of inputting a document image; apartition step of partitioning the input document image into block areasand evaluating attributes of the partitioned block areas; and anextraction step of extraction, from the partitioned block area, a blockarea that at lest partially overlaps an area indicated by the positionand size included in the template information and whose attribute agreeswith the attribute of the overlapped area included in the templateinformation.
 10. The method according to claim 9, wherein said holdingstep holds a plurality of template information of a plurality oftemplates; said method further comprising a selection step of selectingdesired template information from the plurality of template informationof the plurality of templates held at said holding step; wherein saidextraction step extracts, from the partitioned block areas, a block areathat at least partially overlaps an area indicated by the position andsize included in the selected template information and whose attributeagrees with the attributes of the overlapped area included in theselected template information.
 11. The method according to claim 9,wherein said holding step includes; a setting step of setting areas andattributes of the areas with respect to the template; and a registrationstep of registering, as template information, position, size andattribute of each area set at said setting step.
 12. The methodaccording to claim 11, wherein said setting step includes: a displaystep of displaying the template; and a designation step of allowing auser to designate a desired area and attribute on the template displayedat said display step, and wherein said registration step registers, astemplate information, position and size of the area designated at saiddesignation step and the designated attribute.
 13. The method accordingto claim 11, wherein said setting step sets an area and attribute, whichare to serve as template information, by extracting a block area and itsattributes template.
 14. The method according to claim 9, wherein saidholding step includes: an area acquisition step of acquiring a pluralityof areas and attribute of each area from the template; an area selectionstep of selecting a desired area from the plurality of areas acquired atsaid area acquisition step; and a registration step of registering, astemplate information, the selected area and its attribute selected atsaid area selection step.
 15. The method according to claim 9, whereinsaid holding step includes: area acquisition step of acquiring aplurality of areas and attribute of each area from the template; areaselection step for selecting a desired area from the plurality of areasacquired by said area acquisition step; and registration step forregistering, as template information, the area, as well as itsattribute, that has not been selected at said area selection step. 16.The method according to claim 9, wherein said extraction step extracts,from the partitioned the block areas, a block area that overlaps, inexcess of a predetermined ratio, an area indicated by the position andsize included in the template information and whose attribute agreeswith the attribute of the overlapped area included in the templateinformation.
 17. A storage medium storing a control program for causinga computer to extract areas from an input image, said control programcomprising: code of a holding step of holding template informationincluding position, size and attribute in regard to one or a pluralityof areas in a template; code of an image input step of inputting adocument image; code of a partition step of partitioning the inputdocument image into block areas and evaluating attributes of thepartitioned block areas; and code of an extraction step of extracting,from the partitioned block areas, a block area that at least partiallyoverlaps an area indicated by the position and size included in thetemplate information and whose attribute agrees with the attribute ofthe overlapped area included in the template information.